package com.Hadoop.Writable;

import java.io.*;

public class JavaSerializable {
    public static void main(String[] args) throws IOException {
        StudentJava student=new StudentJava();
        student.setId(1L);
        student.setName("hadoop");

        FileOutputStream fileOutputStream=new FileOutputStream("D:\\Java_Serializable.txt");
        ObjectOutputStream outputStream=new ObjectOutputStream(fileOutputStream);
        outputStream.writeObject(student);
        outputStream.close();
        fileOutputStream.close();

    }

}
class StudentJava implements Serializable{
    public static final long serialVersionUID=1L;
    private long id;
    private String name;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
